package com.github.yeecode.mybatisdemo.decorator;

/**
 * 功能说明: <br>
 * 系统版本: 1.0 <br>
 * 开发人员: zhanch
 * 开发时间: 2021/2/25<br>
 * <br>
 */
public class Test {
    public static void main(String[] args) {
        System.out.println("--原有Phone无录音功能--");
        Phone phone = new TelePhone();
        phone.callOut("Hello, this is yee.");

        System.out.println();

        System.out.println("--经过装饰后的Phone有录音功能--");
        Phone phoneWithRecorder = new PhoneRecordDecorator(phone);
        phoneWithRecorder.callOut("Hello, this is yee.");


        // 有短信功能的Phone
        Phone phoneWithMessage = new PhoneMessageDecorator(phone);
        ((PhoneMessageDecorator) phoneWithMessage).sendMessage("Hello, this is yee.");

    }
}
